<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class Login extends Controller {
    
	function __construct(){
		parent::Controller();
	}

    function submit(){
		if(models\Current_user::login(
			$this->input->post('username'),
			$this->input->post('password')
		)) redirect('dashboard');
		else redirect('');
    }

    function logout(){
		models\Current_user::logout();
        redirect('');
    }
}
?>
